export type ILocaleType = 'zh-CN' | 'en';
export interface ILocale {
  locale: ILocaleType;
  label: string;
}
export const useAppLocale = () => {
  const { locale } = useI18n();

  const locales: ILocale[] = [
    { locale: 'zh-CN', label: '简体中文' },
    { locale: 'en', label: 'English' }
  ];

  // 获取当前语言
  const currentLocale = computed(
    () => locales.find((item) => item.locale === locale.value) || locales[0]
  );

  return {
    locales,
    currentLocale
  };
};
